<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
	<title>弹出一个窗口后，后面的层不可操作</title>
	<script type="text/javascript">
		function show () {
			var hidebg = document.getElementById('hidebg');
			hidebg.style.display = "block";
			// hidebg.style.height = document.body.clientHeight + "px";
			hidebg.style.height = window.screen.height + "px";


			var hidebox = document.getElementById('hidebox');
			hidebox.style.display = "block";
		}
		function hide () {
			 var hideobj =  document.getElementById('hidebg');
			 hideobj.style.display = "none";
			 var hidebox = document.getElementById('hidebox');
			 hidebox.style.display = "none";
		}
	</script>
	<style type="text/css">
		body{
			margin: 0px;
			padding: 0px;
			text-align: center;
		}
		#hidebg {
			position: absolute;
			left: 0px;
			top: 0px;
			background-color: #000;
			width:100%;
			filter:alpha(opacity=60);
			opacity: 0.6;
			display: none;
			z-index: 2;
		}
		#hidebox {
			position: absolute;
			width: 40%;
			height: 300px;
			top: 200px;
			left: 30%;
			background-color: #FFF;
			display:none;
			cursor: pointer;
			z-index: 3;
		}
		#content {
			text-align: center;
			cursor: pointer;
			z-index: 1;
		}
	</style>
</head>
<body>
	<div id="hidebg"></div>
	<div id="hidebox" onClick="hide()">点击关闭</div>
	<div id="content" onClick="show()">点击试试</div>
</body>
</html>